<template>
	<view>
		<u-navbar title="我的邀约" :border-bottom='false' title-color='#333333' back-icon-color='#333333' back-icon-size='48'></u-navbar>
		<view class="main">
			<view class="invite-ul">
				<view class="invite-li" v-for="(item,index) in invielist" :key='index'>
					<view class="banner">
						<view class="text">
							{{item.title}}
						</view>
					</view>
					<view class="user">
						<image :src="user.head_pic" mode=""></image>
						<view class="name">
							{{user.nickname}}
						</view>
						<view class="num" @click="isdwon=!isdwon">
							邀请<text>{{item.people_num}}</text>人
							<u-icon class="icon" name="arrow-down" color="#666666" size="20" v-if="isdwon"></u-icon>
							<u-icon class="icon" name="arrow-up" color="#666666" size="20" v-else></u-icon>
						</view>
					</view>
					<view class="member" v-if="isdwon">
						<view class="member-li">
							<image src="../../../static/imgs/del/wodeyybgi.png" mode=""></image>
							<view class="name">
								芒果好吃就是难剥
							</view>
						</view>
						<view class="member-li">
							<image src="../../../static/imgs/del/wodeyybgi.png" mode=""></image>
							<view class="name">
								芒果好吃就是难剥
							</view>
						</view>
						<view class="member-li">
							<image src="../../../static/imgs/del/wodeyybgi.png" mode=""></image>
							<view class="name">
								芒果好吃就是难剥
							</view>
						</view>
					</view>
				</view>
			</view>
			<view class="noCont">
				<u-empty text="暂无邀约" mode="list"></u-empty>
			</view>
		</view>
	</view>
</template>

<script>
	import myRequest from '@/api/index.js'
	export default {
		data(){
			return {
				isdwon:false,
				page:'1',
				invielist:[],
				user:{}
			}
		},
		onLoad() {
			this.myInvitation()
		},
		onShow() {
			this.user = this.$store.state.userInfo
		},
		methods:{
			async myInvitation(){
				let res =await myRequest.getMyinvit({
					page:this.page
				})
				if(res.status) {
					this.invielist =res.data
				}
			}
		}
	}
</script>

<style>
	page {
		background-color: #FFFFFF;
	}
</style>
<style lang="scss" scoped>
	.main {
		padding: 0 20rpx;

		.invite-ul {
			width: 100%;
			height: auto;

			.invite-li {
				margin-bottom: 40rpx;
				box-shadow: 0px 16rpx 20rpx rgba(0, 0, 0, 0.05);
				.banner {
					width: 710rpx;
					height: 280rpx;
					@include bgi('../../../static/imgs/del/wodeyybgi.png');
					padding-left: 28rpx;
					padding-top: 60rpx;
					.text{
						font-size: 40rpx;
						font-family: PingFang SC;
						font-weight: 600;
						color: #FFFFFF;
					}
				}
				.user{
					display: flex;
					align-items: center;
					height: 120rpx;
					image{
						width: 80rpx;
						height: 80rpx;
						border-radius: 50%;
					}
					.name {
						font-size: 32rpx;
						font-family: PingFang SC;
						font-weight: 400;
						color: #333333;
						margin-left: 20rpx;
					}
					.num {
						margin-left: auto;
						font-size: 28rpx;
						font-family: PingFang SC;
						font-weight: 400;
						color: #333333;
						padding-left: 4rpx;
						text{
							color: #FB4F4B;
						}
						.icon{
							margin-left: 4rpx;
						}
					}
				}
				.member {
					.member-li{
						display: flex;
						align-items: center;
						height: 88rpx;
						image{
							width: 64rpx;
							height: 64rpx;
							border-radius: 50%;
						}
						.name{
							font-size: 28rpx;
							font-family: PingFang SC;
							font-weight: 400;
							color: #999999;
							margin-left: 20rpx;
						}
					}
				}
			}
		}
	}
	
	.noCont {
		padding-top: 420rpx;
	}
</style>
